package org.zerg.controller.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zerg.entity.Banner;
import org.zerg.service.BannerService;

@Controller
@RequestMapping("/api")
public class BannerController {

	@Autowired
	private BannerService bannerService;
	
	@RequestMapping(value="/banner/{id}", method = RequestMethod.GET,
            produces = {"application/json;charset=UTF-8"})
	@ResponseBody
	public Banner getBannerById(@PathVariable(value="id") Integer id){
		Banner banner = bannerService.getBannerById(id);
		return banner;
	}
}
